@marimo-team/frontend 0.16.1 → 0.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ConnectedDataExplorerComponent-2wVcyvDj.js → ConnectedDataExplorerComponent-B5cPvWoQ.js} +1 -1
- package/dist/assets/{ImageComparisonComponent-D2j6i0hv.js → ImageComparisonComponent-CqR26LSv.js} +1 -1
- package/dist/assets/{VegaLite-BckFaf2D.js → VegaLite-DvQDATwI.js} +1 -1
- package/dist/assets/_baseEach--KDTwKbG.js +1 -0
- package/dist/assets/_baseMap-Cu3o-eyO.js +1 -0
- package/dist/assets/{_baseUniq-BKktIGQ1.js → _baseUniq-y7ZXnMo1.js} +1 -1
- package/dist/assets/{_createAggregator-C5CVY-0t.js → _createAggregator-ZcHkHPNJ.js} +1 -1
- package/dist/assets/{agent-panel-RGLNjkYe.js → agent-panel-B91RoLct.js} +6 -6
- package/dist/assets/{any-language-editor-DjuXwGCA.js → any-language-editor-CxfHcm5h.js} +1 -1
- package/dist/assets/{architectureDiagram-W76B3OCA-Dyj4ds_R.js → architectureDiagram-W76B3OCA-BQsvK8uR.js} +1 -1
- package/dist/assets/{between-horizontal-start-Dt2aKpPf.js → between-horizontal-start-BmYToIaM.js} +1 -1
- package/dist/assets/{blockDiagram-QIGZ2CNN-o-i7DDvN.js → blockDiagram-QIGZ2CNN-r3HgCj4w.js} +1 -1
- package/dist/assets/{c4Diagram-FPNF74CW-DGHEwWrx.js → c4Diagram-FPNF74CW-BJbPNt41.js} +1 -1
- package/dist/assets/channel-DFaEx1fu.js +1 -0
- package/dist/assets/{chat-panel-9alr8FS4.js → chat-panel-IoPMv8e2.js} +3 -3
- package/dist/assets/{chunk-4BX2VUAB-BJecb-Ri.js → chunk-4BX2VUAB-Dv4MZ9Hj.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-CAATkc4w.js → chunk-55IACEB6-CM4AHquB.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-DPuNbQ-f.js → chunk-FMBD7UC4-C_Zz0ENB.js} +1 -1
- package/dist/assets/{chunk-K7UQS3LO-C8TWVLiH.js → chunk-K7UQS3LO-DYSmiXYq.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-DiZZ09q4.js → chunk-QN33PNHL-QM4OPuQP.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-BIUM7usu.js → chunk-QZHKN3VN-CfAsGyeB.js} +1 -1
- package/dist/assets/{chunk-TVAH2DTR-vGTArPBG.js → chunk-TVAH2DTR-6j_Cpjsi.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-D2KRqp_x.js → chunk-TZMSLE5B-BHslFJQE.js} +1 -1
- package/dist/assets/{circle-play-cjeNez0N.js → circle-play-CK3UZRYQ.js} +1 -1
- package/dist/assets/classDiagram-KNZD7YFC-BsZtvV5O.js +1 -0
- package/dist/assets/classDiagram-v2-RKCZMP56-BsZtvV5O.js +1 -0
- package/dist/assets/{clear-button-C97JtAez.js → clear-button-C4fDVSv8.js} +1 -1
- package/dist/assets/clone-YBEvPE-s.js +1 -0
- package/dist/assets/command-palette-D7hOfvf6.js +1 -0
- package/dist/assets/{common-Du9rSOwD.js → common-D-lbuUwz.js} +1 -1
- package/dist/assets/{compile-CZXqyOxa.js → compile-DVQe1Mzk.js} +1 -1
- package/dist/assets/{cose-bilkent-S5V4N54A-CqUN5Y9b.js → cose-bilkent-S5V4N54A-D-IS7WC8.js} +1 -1
- package/dist/assets/{dagre-5GWH7T2D-RJqTI9DM.js → dagre-5GWH7T2D-lYu-tEWT.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-DZN0q1LV.js → data-grid-overlay-editor-C5peOCit.js} +1 -1
- package/dist/assets/datasources-panel-D3NA20uZ.js +1 -0
- package/dist/assets/{dependency-graph-panel-CEog_O7V.js → dependency-graph-panel-BGVYOfkV.js} +1 -1
- package/dist/assets/{diagram-N5W7TBWH-D-l4zZ9d.js → diagram-N5W7TBWH-BnvIuYUp.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-CCOmBUt-.js → diagram-QEK2KX5R-DemedRK3.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-C_I_9jnZ.js → diagram-S2PKOQOG-iiY7AuyH.js} +1 -1
- package/dist/assets/{documentation-panel-C1BtMZ3M.js → documentation-panel-C3dSwOSQ.js} +1 -1
- package/dist/assets/{edit-page-B-oevUZ9.js → edit-page-C5TsEeSo.js} +17 -17
- package/dist/assets/{ellipsis-vertical-BEb-J8z6.js → ellipsis-vertical-CazJl8M7.js} +1 -1
- package/dist/assets/{empty-state-C99UyDE3.js → empty-state-DW308mFO.js} +1 -1
- package/dist/assets/{erDiagram-AWTI2OKA-BePOLi5M.js → erDiagram-AWTI2OKA-6wQ8Ugg0.js} +1 -1
- package/dist/assets/{error-panel-Bs34jXFh.js → error-panel-D1VnJ1yP.js} +1 -1
- package/dist/assets/{file-explorer-panel-Ck6UL861.js → file-explorer-panel-0oVd4t-D.js} +1 -1
- package/dist/assets/{flowDiagram-PVAE7QVJ-BgjFu5l7.js → flowDiagram-PVAE7QVJ-C55IUWjm.js} +1 -1
- package/dist/assets/{ganttDiagram-OWAHRB6G-YOPb3XSV.js → ganttDiagram-OWAHRB6G-DmqCM6ME.js} +1 -1
- package/dist/assets/{gitGraphDiagram-NY62KEGX-CGhqaDTy.js → gitGraphDiagram-NY62KEGX-DBvhAeM_.js} +1 -1
- package/dist/assets/{glide-data-editor-9QUH6iso.js → glide-data-editor-CHNuHidQ.js} +11 -11
- package/dist/assets/{graph-DQQFGrho.js → graph-CG6BgUWQ.js} +1 -1
- package/dist/assets/{home-page-DRKpPCrF.js → home-page-dgivXuSR.js} +3 -3
- package/dist/assets/{index-SGLNXrGP.js → index-BTGpssVX.js} +1 -1
- package/dist/assets/{index-Aeo6WiK7.js → index-BYVZlBF8.js} +1 -1
- package/dist/assets/{index-CUFv_thQ.js → index-BelfnXwL.js} +1 -1
- package/dist/assets/{index-DdnKZNxM.js → index-BneyUujp.js} +1 -1
- package/dist/assets/{index-BJNCMUmG.js → index-C02SqeRj.js} +1 -1
- package/dist/assets/{index-aE43R74q.js → index-C7dtgr9A.js} +1 -1
- package/dist/assets/{index-C2MD0vgD.js → index-CAQvMTzM.js} +1 -1
- package/dist/assets/index-CGDMlQfO.css +1 -0
- package/dist/assets/index-CelXfcd8.js +580 -0
- package/dist/assets/{index-C_tkBKNO.js → index-Csd6QrCV.js} +1 -1
- package/dist/assets/{index-BAbIIxHU.js → index-CtPksxf0.js} +1 -1
- package/dist/assets/{index-2252nrk6.js → index-Cxyk7pt-.js} +1 -1
- package/dist/assets/{index-BW3k9Gss.js → index-DAZ-9ri2.js} +1 -1
- package/dist/assets/{index-ClzeQrN7.js → index-DONRrmA2.js} +1 -1
- package/dist/assets/{index-B8jXZ12t.js → index-Db36XTG_.js} +1 -1
- package/dist/assets/{index-BprjMYH5.js → index-DdIhdEVw.js} +1 -1
- package/dist/assets/{index-CFKO7WXI.js → index-M_pBKDSe.js} +1 -1
- package/dist/assets/{index-CfaDbEdi.js → index-_luCZMLM.js} +1 -1
- package/dist/assets/{index-BjgnbONl.js → index-mkubqy9-.js} +1 -1
- package/dist/assets/{index-C1ez98sk.js → index-sbO9UaUU.js} +1 -1
- package/dist/assets/{index-G5QZppK2.js → index-z4krxQ4j.js} +1 -1
- package/dist/assets/infoDiagram-STP46IZ2-wTALjfPc.js +2 -0
- package/dist/assets/{isEmpty-D-4c7sMv.js → isEmpty-CqX_YTIf.js} +1 -1
- package/dist/assets/{journeyDiagram-BIP6EPQ6-C94u3Mv3.js → journeyDiagram-BIP6EPQ6-Y5w_Tqe_.js} +1 -1
- package/dist/assets/{kanban-definition-6OIFK2YF-BEXYFzz7.js → kanban-definition-6OIFK2YF-DbXs5Rxi.js} +1 -1
- package/dist/assets/{layout-Bz2BJ2ru.js → layout-BCNPDACj.js} +1 -1
- package/dist/assets/{linear-D8s7K76e.js → linear-uO6UVhXt.js} +1 -1
- package/dist/assets/{links-BpXlz1GG.js → links-Drv7cJgN.js} +3 -3
- package/dist/assets/{logs-panel-DC7wpmPz.js → logs-panel-BEQ1eRUp.js} +1 -1
- package/dist/assets/{markdown-renderer-DRdSWR9X.js → markdown-renderer-Dmzbb00W.js} +3 -3
- package/dist/assets/{mermaid-Y3x4hmD0.js → mermaid-qRc4MXIj.js} +1 -1
- package/dist/assets/{mermaid.core-DzthE35Y.js → mermaid.core-CvvJtCRj.js} +4 -4
- package/dist/assets/min-DYUOb1RR.js +1 -0
- package/dist/assets/{mindmap-definition-Q6HEUPPD-DktvuLe1.js → mindmap-definition-Q6HEUPPD-G5NognM-.js} +1 -1
- package/dist/assets/{number-overlay-editor-BEfwI1IT.js → number-overlay-editor-DPr5sHFu.js} +1 -1
- package/dist/assets/{outline-panel-CdsnAy2w.js → outline-panel-gxQXvVi4.js} +1 -1
- package/dist/assets/{packages-panel-DiTA-d_D.js → packages-panel-B1T0VPlg.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX-DQDNQ-de.js → pieDiagram-ADFJNKIX-DK9SHkfc.js} +1 -1
- package/dist/assets/{quadrantDiagram-LMRXKWRM-0kgIXc2-.js → quadrantDiagram-LMRXKWRM-D1DdWF8C.js} +1 -1
- package/dist/assets/{react-plotly-DJqqfM7c.js → react-plotly-CTwajqCb.js} +1 -1
- package/dist/assets/{requirementDiagram-4UW4RH46-B5rb0ypd.js → requirementDiagram-4UW4RH46-DnjDAypr.js} +1 -1
- package/dist/assets/{run-page-CFmLrv1R.js → run-page-CQY9im22.js} +1 -1
- package/dist/assets/{sankeyDiagram-GR3RE2ED-Dom7IlnF.js → sankeyDiagram-GR3RE2ED-B67Va-ER.js} +1 -1
- package/dist/assets/{scratchpad-panel-CuHWpHO8.js → scratchpad-panel-DlDfcDtW.js} +1 -1
- package/dist/assets/{secrets-panel-CfHc5YD0.js → secrets-panel-BDGyuGZA.js} +1 -1
- package/dist/assets/{sequenceDiagram-C3RYC4MD-PNJWXQbw.js → sequenceDiagram-C3RYC4MD-DiWgZPtN.js} +1 -1
- package/dist/assets/{slides-component-CJgaTRZ0.js → slides-component-DhpPRtQp.js} +1 -1
- package/dist/assets/{snippets-panel-B2EC1txM.js → snippets-panel-CLkBXhJ2.js} +1 -1
- package/dist/assets/{sortBy-DZnlX29-.js → sortBy-D4OG7w4O.js} +1 -1
- package/dist/assets/{state-CWict9RU.js → state-Dz_3JyED.js} +1 -1
- package/dist/assets/{stateDiagram-KXAO66HF-BE58aJnr.js → stateDiagram-KXAO66HF-ByF2AULw.js} +1 -1
- package/dist/assets/stateDiagram-v2-UMBNRL4Z-CtBJqosP.js +1 -0
- package/dist/assets/{storage-DRaR04wR.js → storage-Dr0CC44z.js} +6 -6
- package/dist/assets/{terminal-BX3Su5q7.js → terminal-BtdissBf.js} +1 -1
- package/dist/assets/{time-hUzZfpNE.js → time-DKdOTnQg.js} +1 -1
- package/dist/assets/{timeline-definition-XQNQX7LJ-CqQP9t51.js → timeline-definition-XQNQX7LJ-DzER9bf6.js} +1 -1
- package/dist/assets/{tracing-B10Q1n-L.js → tracing-Dpx5M-u3.js} +2 -2
- package/dist/assets/{tracing-panel-Du8WCnno.js → tracing-panel-hCjBkSER.js} +2 -2
- package/dist/assets/{trash-B81GTiv6.js → trash-C6Ko-g5q.js} +1 -1
- package/dist/assets/{tree-6vW2ogkh.js → tree-BHN2gcCF.js} +6 -6
- package/dist/assets/{treemap-75Q7IDZK-CdwDwwsz.js → treemap-75Q7IDZK-DR79Mhzt.js} +1 -1
- package/dist/assets/{variable-panel-D5qgJI7k.js → variable-panel-PFBCFz36.js} +1 -1
- package/dist/assets/{vega-component-DJaJWMJM.js → vega-component-Db6-uY4C.js} +1 -1
- package/dist/assets/{xychartDiagram-6GGTOJPD-WFtXqaM9.js → xychartDiagram-6GGTOJPD-DWzBP3tZ.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +3 -3
- package/src/__mocks__/requests.ts +1 -0
- package/src/components/data-table/__tests__/columns.test.tsx +38 -0
- package/src/components/data-table/cell-hover-template/feature.ts +1 -1
- package/src/components/data-table/cell-hover-template/types.ts +1 -1
- package/src/components/data-table/columns.tsx +21 -2
- package/src/components/data-table/renderers.tsx +16 -8
- package/src/components/data-table/schemas.ts +16 -0
- package/src/components/editor/Cell.tsx +2 -0
- package/src/components/editor/errors/sql-validation-errors.tsx +34 -0
- package/src/components/editor/output/ConsoleOutput.tsx +13 -1
- package/src/components/editor/output/MarimoErrorOutput.tsx +60 -1
- package/src/core/ai/context/providers/cell-output.ts +1 -18
- package/src/core/codemirror/language/__tests__/extension.test.ts +24 -0
- package/src/core/codemirror/language/__tests__/sql-validation.test.ts +133 -0
- package/src/core/codemirror/language/languages/sql/sql-mode.ts +20 -0
- package/src/core/codemirror/language/languages/sql/sql.ts +90 -3
- package/src/core/codemirror/language/languages/sql/validation-errors.ts +79 -0
- package/src/core/codemirror/language/panel/panel.tsx +8 -2
- package/src/core/codemirror/language/panel/sql.tsx +81 -4
- package/src/core/config/feature-flag.tsx +3 -1
- package/src/core/datasets/request-registry.ts +17 -1
- package/src/core/islands/bridge.ts +1 -0
- package/src/core/islands/main.ts +1 -0
- package/src/core/kernel/messages.ts +1 -0
- package/src/core/network/requests-network.ts +7 -0
- package/src/core/network/requests-static.ts +1 -0
- package/src/core/network/requests-toasting.ts +1 -0
- package/src/core/network/types.ts +2 -0
- package/src/core/wasm/bridge.ts +5 -0
- package/src/core/websocket/useMarimoWebSocket.tsx +4 -0
- package/src/plugins/core/registerReactComponent.tsx +23 -19
- package/src/plugins/impl/DataTablePlugin.tsx +11 -4
- package/src/plugins/impl/data-frames/DataFramePlugin.tsx +17 -5
- package/src/stories/dataframe.stories.tsx +2 -0
- package/src/utils/__tests__/dom.test.ts +167 -0
- package/src/utils/dom.ts +55 -0
- package/dist/assets/_baseEach-CvTX9w0Y.js +0 -1
- package/dist/assets/_baseMap-CtlwA90f.js +0 -1
- package/dist/assets/channel-Co6iMgWq.js +0 -1
- package/dist/assets/classDiagram-KNZD7YFC-BbJ0rY3y.js +0 -1
- package/dist/assets/classDiagram-v2-RKCZMP56-BbJ0rY3y.js +0 -1
- package/dist/assets/clone-BMP0PsTa.js +0 -1
- package/dist/assets/command-palette-B93Pjcky.js +0 -1
- package/dist/assets/datasources-panel-v7H3cR0p.js +0 -1
- package/dist/assets/index-C7CoaNFb.js +0 -578
- package/dist/assets/index-DadI618h.css +0 -1
- package/dist/assets/infoDiagram-STP46IZ2-CJLOpSAf.js +0 -2
- package/dist/assets/min-BBO3-1Hg.js +0 -1
- package/dist/assets/stateDiagram-v2-UMBNRL4Z-CdThjimL.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Gn,ai as zn,
|
|
1
|
+
import{c as Gn,ai as zn,gv as po,j as x,gw as ho,gx as go,gy as mo,gz as yo,a as ve,r as Yn,dr as ke,gA as vo,gB as bo,T as xo,a_ as Qn,dv as pt,gC as Vn,dj as ht,dk as Ke,dy as gt,L as Eo,f4 as To,M as So,av as wo,K as Kt,dw as Kn,eh as No,gD as Jn,gE as Co,c5 as Ao,gF as Oo,gG as ko,gH as Mo,b as Io,u as Uo,dP as Fo,E as Do,aB as _o,gI as jo,cv as Po,_ as Ro,d as $o}from"./index-CelXfcd8.js";import{U as Bo,e as Lo,V as Wo}from"./compile-DVQe1Mzk.js";import{a as Xn}from"./VegaLite-DvQDATwI.js";import"./time-DKdOTnQg.js";import"./timer-Bqd5yn_a.js";import"./linear-uO6UVhXt.js";import"./init-DLRA0X12.js";import"./range-CtcPcB_L.js";import"./zoom-COrs4lFh.js";import"./ordinal-DDUp3AbE.js";import"./colors-bszWmPJw.js";import"./step-BwsUM5iJ.js";import"./arc-Cuwikxov.js";import"./index-BEQfoZiP.js";import"./index-Db36XTG_.js";/**
|
|
2
2
|
* @license lucide-react v0.542.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
package/dist/assets/{ImageComparisonComponent-D2j6i0hv.js → ImageComparisonComponent-CqR26LSv.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cS as D,a as k,j as x}from"./index-C7CoaNFb.js";var T,M,p={},L={},P=(function(){if(M)return p;M=1;var E=p&&p.__createBinding||(Object.create?function(d,c,l,t){t===void 0&&(t=l),Object.defineProperty(d,t,{enumerable:!0,get:function(){return c[l]}})}:function(d,c,l,t){t===void 0&&(t=l),d[t]=c[l]}),i=p&&p.__setModuleDefault||(Object.create?function(d,c){Object.defineProperty(d,"default",{enumerable:!0,value:c})}:function(d,c){d.default=c}),y=p&&p.__importStar||function(d){if(d&&d.__esModule)return d;var c={};if(d!=null)for(var l in d)l!=="default"&&Object.prototype.hasOwnProperty.call(d,l)&&E(c,d,l);return i(c,d),c};Object.defineProperty(p,"__esModule",{value:!0}),p.ImgComparisonSlider=void 0;const w=D();return typeof document<"u"&&Promise.resolve().then(()=>y((T||(T=1,(()=>{var d={792:(t,a,r)=>{r.d(a,{Z:()=>v});var n=r(609),u=r.n(n)()(function(f){return f[1]});u.push([t.id,':host{--divider-width: 1px;--divider-color: #fff;--divider-shadow: none;--default-handle-width: 50px;--default-handle-color: #fff;--default-handle-opacity: 1;--default-handle-shadow: none;--handle-position-start: 50%;position:relative;display:inline-block;overflow:hidden;line-height:0;direction:ltr}@media screen and (-webkit-min-device-pixel-ratio: 0)and (min-resolution: 0.001dpcm){:host{outline-offset:1px}}:host(:focus){outline:2px solid -webkit-focus-ring-color}::slotted(*){-webkit-user-drag:none;-khtml-user-drag:none;-moz-user-drag:none;-o-user-drag:none;user-drag:none;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.first{position:absolute;left:0;top:0;right:0;line-height:normal;font-size:100%;max-height:100%;height:100%;width:100%;--exposure: 50%;--keyboard-transition-time: 0ms;--default-transition-time: 0ms;--transition-time: var(--default-transition-time)}.first .first-overlay-container{position:relative;clip-path:inset(0 var(--exposure) 0 0);transition:clip-path var(--transition-time);height:100%}.first .first-overlay{overflow:hidden;height:100%}.first.focused{will-change:clip-path}.first.focused .first-overlay-container{will-change:clip-path}.second{position:relative}.handle-container{transform:translateX(50%);position:absolute;top:0;right:var(--exposure);height:100%;transition:right var(--transition-time),bottom var(--transition-time)}.focused .handle-container{will-change:right}.divider{position:absolute;height:100%;width:100%;left:0;top:0;display:flex;align-items:center;justify-content:center;flex-direction:column}.divider:after{content:" ";display:block;height:100%;border-left-width:var(--divider-width);border-left-style:solid;border-left-color:var(--divider-color);box-shadow:var(--divider-shadow)}.handle{position:absolute;top:var(--handle-position-start);pointer-events:none;box-sizing:border-box;margin-left:1px;transform:translate(calc(-50% - 0.5px), -50%);line-height:0}.default-handle{width:var(--default-handle-width);opacity:var(--default-handle-opacity);transition:all 1s;filter:drop-shadow(var(--default-handle-shadow))}.default-handle path{stroke:var(--default-handle-color)}.vertical .first-overlay-container{clip-path:inset(0 0 var(--exposure) 0)}.vertical .handle-container{transform:translateY(50%);height:auto;top:unset;bottom:var(--exposure);width:100%;left:0;flex-direction:row}.vertical .divider:after{height:1px;width:100%;border-top-width:var(--divider-width);border-top-style:solid;border-top-color:var(--divider-color);border-left:0}.vertical .handle{top:auto;left:var(--handle-position-start);transform:translate(calc(-50% - 0.5px), -50%) rotate(90deg)}',""]);const v=u},609:t=>{t.exports=function(a){var r=[];return r.toString=function(){return this.map(function(n){var u=a(n);return n[2]?"@media ".concat(n[2]," {").concat(u,"}"):u}).join("")},r.i=function(n,u,v){typeof n=="string"&&(n=[[null,n,""]]);var f={};if(v)for(var m=0;m<this.length;m++){var g=this[m][0];g!=null&&(f[g]=!0)}for(var e=0;e<n.length;e++){var s=[].concat(n[e]);v&&f[s[0]]||(u&&(s[2]?s[2]="".concat(u," and ").concat(s[2]):s[2]=u),r.push(s))}},r}}},c={};function l(t){var a=c[t];if(a!==void 0)return a.exports;var r=c[t]={id:t,exports:{}};return d[t](r,r.exports,l),r.exports}l.n=t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return l.d(a,{a}),a},l.d=(t,a)=>{for(var r in a)l.o(a,r)&&!l.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},l.o=(t,a)=>Object.prototype.hasOwnProperty.call(t,a),(()=>{var t=l(792);const a="rendered",r=(e,s)=>{const o=e.getBoundingClientRect();let h,b;return s.type==="mousedown"?(h=s.clientX,b=s.clientY):(h=s.touches[0].clientX,b=s.touches[0].clientY),h>=o.x&&h<=o.x+o.width&&b>=o.y&&b<=o.y+o.height};let n;const u={ArrowLeft:-1,ArrowRight:1},v=["horizontal","vertical"],f=e=>({x:e.touches[0].pageX,y:e.touches[0].pageY}),m=e=>({x:e.pageX,y:e.pageY}),g=typeof window<"u"&&(window==null?void 0:window.HTMLElement);typeof window<"u"&&(window.document&&(n=document.createElement("template"),n.innerHTML='<div class="second" id="second"> <slot name="second"><slot name="before"></slot></slot> </div> <div class="first" id="first"> <div class="first-overlay"> <div class="first-overlay-container" id="firstImageContainer"> <slot name="first"><slot name="after"></slot></slot> </div> </div> <div class="handle-container"> <div class="divider"></div> <div class="handle" id="handle"> <slot name="handle"> <svg xmlns="http://www.w3.org/2000/svg" class="default-handle" viewBox="-8 -3 16 6"> <path d="M -5 -2 L -7 0 L -5 2 M 5 -2 L 7 0 L 5 2" fill="none" vector-effect="non-scaling-stroke"/> </svg> </slot> </div> </div> </div> '),window.customElements.define("img-comparison-slider",class extends g{constructor(){super(),this.exposure=this.hasAttribute("value")?parseFloat(this.getAttribute("value")):50,this.slideOnHover=!1,this.slideDirection="horizontal",this.keyboard="enabled",this.isMouseDown=!1,this.animationDirection=0,this.isFocused=!1,this.dragByHandle=!1,this.onMouseMove=o=>{if(this.isMouseDown||this.slideOnHover){const h=m(o);this.slideToPage(h)}},this.bodyUserSelectStyle="",this.bodyWebkitUserSelectStyle="",this.onMouseDown=o=>{if(this.slideOnHover||this.handle&&!r(this.handleElement,o))return;o.preventDefault(),window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mouseup",this.onWindowMouseUp),this.isMouseDown=!0,this.enableTransition();const h=m(o);this.slideToPage(h),this.focus(),this.bodyUserSelectStyle=window.document.body.style.userSelect,this.bodyWebkitUserSelectStyle=window.document.body.style.webkitUserSelect,window.document.body.style.userSelect="none",window.document.body.style.webkitUserSelect="none"},this.onWindowMouseUp=()=>{this.isMouseDown=!1,window.document.body.style.userSelect=this.bodyUserSelectStyle,window.document.body.style.webkitUserSelect=this.bodyWebkitUserSelectStyle,window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onWindowMouseUp)},this.touchStartPoint=null,this.isTouchComparing=!1,this.hasTouchMoved=!1,this.onTouchStart=o=>{this.dragByHandle&&!r(this.handleElement,o)||(this.touchStartPoint=f(o),this.isFocused&&(this.enableTransition(),this.slideToPage(this.touchStartPoint)))},this.onTouchMove=o=>{if(this.touchStartPoint===null)return;const h=f(o);if(this.isTouchComparing)return this.slideToPage(h),o.preventDefault(),!1;if(!this.hasTouchMoved){const b=Math.abs(h.y-this.touchStartPoint.y),S=Math.abs(h.x-this.touchStartPoint.x);if(this.slideDirection==="horizontal"&&b<S||this.slideDirection==="vertical"&&b>S)return this.isTouchComparing=!0,this.focus(),this.slideToPage(h),o.preventDefault(),!1;this.hasTouchMoved=!0}},this.onTouchEnd=()=>{this.isTouchComparing=!1,this.hasTouchMoved=!1,this.touchStartPoint=null},this.onBlur=()=>{this.stopSlideAnimation(),this.isFocused=!1,this.firstElement.classList.remove("focused")},this.onFocus=()=>{this.isFocused=!0,this.firstElement.classList.add("focused")},this.onKeyDown=o=>{if(this.keyboard==="disabled")return;const h=u[o.key];this.animationDirection!==h&&h!==void 0&&(this.animationDirection=h,this.startSlideAnimation())},this.onKeyUp=o=>{if(this.keyboard==="disabled")return;const h=u[o.key];h!==void 0&&this.animationDirection===h&&this.stopSlideAnimation()},this.resetDimensions=()=>{this.imageWidth=this.offsetWidth,this.imageHeight=this.offsetHeight};const e=this.attachShadow({mode:"open"}),s=document.createElement("style");s.innerHTML=t.Z,this.getAttribute("nonce")&&s.setAttribute("nonce",this.getAttribute("nonce")),e.appendChild(s),e.appendChild(n.content.cloneNode(!0)),this.firstElement=e.getElementById("first"),this.handleElement=e.getElementById("handle")}set handle(e){this.dragByHandle=e.toString().toLowerCase()!=="false"}get handle(){return this.dragByHandle}get value(){return this.exposure}set value(e){const s=parseFloat(e);s!==this.exposure&&(this.exposure=s,this.enableTransition(),this.setExposure())}get hover(){return this.slideOnHover}set hover(e){this.slideOnHover=e.toString().toLowerCase()!=="false",this.removeEventListener("mousemove",this.onMouseMove),this.slideOnHover&&this.addEventListener("mousemove",this.onMouseMove)}get direction(){return this.slideDirection}set direction(e){this.slideDirection=e.toString().toLowerCase(),this.slide(0),this.firstElement.classList.remove(...v),v.includes(this.slideDirection)&&this.firstElement.classList.add(this.slideDirection)}static get observedAttributes(){return["hover","direction"]}connectedCallback(){this.hasAttribute("tabindex")||(this.tabIndex=0),this.addEventListener("dragstart",e=>(e.preventDefault(),!1)),new ResizeObserver(this.resetDimensions).observe(this),this.setExposure(0),this.keyboard=this.hasAttribute("keyboard")&&this.getAttribute("keyboard")==="disabled"?"disabled":"enabled",this.addEventListener("keydown",this.onKeyDown),this.addEventListener("keyup",this.onKeyUp),this.addEventListener("focus",this.onFocus),this.addEventListener("blur",this.onBlur),this.addEventListener("touchstart",this.onTouchStart,{passive:!0}),this.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.addEventListener("touchend",this.onTouchEnd),this.addEventListener("mousedown",this.onMouseDown),this.handle=this.hasAttribute("handle")?this.getAttribute("handle"):this.dragByHandle,this.hover=this.hasAttribute("hover")?this.getAttribute("hover"):this.slideOnHover,this.direction=this.hasAttribute("direction")?this.getAttribute("direction"):this.slideDirection,this.resetDimensions(),this.classList.contains(a)||this.classList.add(a)}disconnectedCallback(){this.transitionTimer&&window.clearTimeout(this.transitionTimer)}attributeChangedCallback(e,s,o){e==="hover"&&(this.hover=o),e==="direction"&&(this.direction=o),e==="keyboard"&&(this.keyboard=o==="disabled"?"disabled":"enabled")}setExposure(e=0){var s;this.exposure=(s=this.exposure+e)<0?0:s>100?100:s,this.firstElement.style.setProperty("--exposure",100-this.exposure+"%")}slide(e=0){this.setExposure(e);const s=new Event("slide");this.dispatchEvent(s)}slideToPage(e){this.slideDirection==="horizontal"&&this.slideToPageX(e.x),this.slideDirection==="vertical"&&this.slideToPageY(e.y)}slideToPageX(e){const s=e-this.getBoundingClientRect().left-window.scrollX;this.exposure=s/this.imageWidth*100,this.slide(0)}slideToPageY(e){const s=e-this.getBoundingClientRect().top-window.scrollY;this.exposure=s/this.imageHeight*100,this.slide(0)}enableTransition(){this.firstElement.style.setProperty("--transition-time","100ms"),this.transitionTimer=window.setTimeout(()=>{this.firstElement.style.setProperty("--transition-time","var(--default-transition-time)"),this.transitionTimer=null},100)}startSlideAnimation(){let e=null,s=this.animationDirection;this.firstElement.style.setProperty("--transition-time","var(--keyboard-transition-time)");const o=h=>{if(this.animationDirection===0||s!==this.animationDirection)return;e===null&&(e=h);const b=(h-e)/16.666666666666668*this.animationDirection;this.slide(b),setTimeout(()=>window.requestAnimationFrame(o),0),e=h};window.requestAnimationFrame(o)}stopSlideAnimation(){this.animationDirection=0,this.firstElement.style.setProperty("--transition-time","var(--default-transition-time)")}}))})()})()),L))),p.ImgComparisonSlider=(0,w.forwardRef)(({children:d,onSlide:c,value:l,className:t,...a},r)=>{const n=(0,w.useRef)();return(0,w.useEffect)(()=>{l!==void 0&&(n.current.value=parseFloat(l.toString()))},[l,n]),(0,w.useEffect)(()=>{c&&n.current.addEventListener("slide",c)},[]),(0,w.useImperativeHandle)(r,()=>n.current,[n]),(0,w.createElement)("img-comparison-slider",Object.assign({class:t?`${t} rendered`:"rendered",tabIndex:0,ref:n},a),d)}),p})();const A=E=>{const i=k.c(15),{beforeSrc:y,afterSrc:w,value:d,direction:c,width:l,height:t}=E,a=l||"100%",r=t||(c==="vertical"?"400px":"auto");let n;i[0]!==a||i[1]!==r?(n={width:a,height:r,maxWidth:"100%"},i[0]=a,i[1]=r,i[2]=n):n=i[2];const u=n;let v,f,m,g;return i[3]!==y?(v=x.jsx("img",{slot:"first",src:y,alt:"Before",width:"100%"}),i[3]=y,i[4]=v):v=i[4],i[5]!==w?(f=x.jsx("img",{slot:"second",src:w,alt:"After",width:"100%"}),i[5]=w,i[6]=f):f=i[6],i[7]!==c||i[8]!==v||i[9]!==f||i[10]!==d?(m=x.jsxs(P.ImgComparisonSlider,{value:d,direction:c,children:[v,f]}),i[7]=c,i[8]=v,i[9]=f,i[10]=d,i[11]=m):m=i[11],i[12]!==u||i[13]!==m?(g=x.jsx("div",{style:u,children:m}),i[12]=u,i[13]=m,i[14]=g):g=i[14],g};export{A as default};
|
|
1
|
+
import{cU as D,a as k,j as x}from"./index-CelXfcd8.js";var T,M,p={},L={},P=(function(){if(M)return p;M=1;var E=p&&p.__createBinding||(Object.create?function(d,c,l,t){t===void 0&&(t=l),Object.defineProperty(d,t,{enumerable:!0,get:function(){return c[l]}})}:function(d,c,l,t){t===void 0&&(t=l),d[t]=c[l]}),i=p&&p.__setModuleDefault||(Object.create?function(d,c){Object.defineProperty(d,"default",{enumerable:!0,value:c})}:function(d,c){d.default=c}),y=p&&p.__importStar||function(d){if(d&&d.__esModule)return d;var c={};if(d!=null)for(var l in d)l!=="default"&&Object.prototype.hasOwnProperty.call(d,l)&&E(c,d,l);return i(c,d),c};Object.defineProperty(p,"__esModule",{value:!0}),p.ImgComparisonSlider=void 0;const w=D();return typeof document<"u"&&Promise.resolve().then(()=>y((T||(T=1,(()=>{var d={792:(t,a,r)=>{r.d(a,{Z:()=>v});var n=r(609),u=r.n(n)()(function(f){return f[1]});u.push([t.id,':host{--divider-width: 1px;--divider-color: #fff;--divider-shadow: none;--default-handle-width: 50px;--default-handle-color: #fff;--default-handle-opacity: 1;--default-handle-shadow: none;--handle-position-start: 50%;position:relative;display:inline-block;overflow:hidden;line-height:0;direction:ltr}@media screen and (-webkit-min-device-pixel-ratio: 0)and (min-resolution: 0.001dpcm){:host{outline-offset:1px}}:host(:focus){outline:2px solid -webkit-focus-ring-color}::slotted(*){-webkit-user-drag:none;-khtml-user-drag:none;-moz-user-drag:none;-o-user-drag:none;user-drag:none;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.first{position:absolute;left:0;top:0;right:0;line-height:normal;font-size:100%;max-height:100%;height:100%;width:100%;--exposure: 50%;--keyboard-transition-time: 0ms;--default-transition-time: 0ms;--transition-time: var(--default-transition-time)}.first .first-overlay-container{position:relative;clip-path:inset(0 var(--exposure) 0 0);transition:clip-path var(--transition-time);height:100%}.first .first-overlay{overflow:hidden;height:100%}.first.focused{will-change:clip-path}.first.focused .first-overlay-container{will-change:clip-path}.second{position:relative}.handle-container{transform:translateX(50%);position:absolute;top:0;right:var(--exposure);height:100%;transition:right var(--transition-time),bottom var(--transition-time)}.focused .handle-container{will-change:right}.divider{position:absolute;height:100%;width:100%;left:0;top:0;display:flex;align-items:center;justify-content:center;flex-direction:column}.divider:after{content:" ";display:block;height:100%;border-left-width:var(--divider-width);border-left-style:solid;border-left-color:var(--divider-color);box-shadow:var(--divider-shadow)}.handle{position:absolute;top:var(--handle-position-start);pointer-events:none;box-sizing:border-box;margin-left:1px;transform:translate(calc(-50% - 0.5px), -50%);line-height:0}.default-handle{width:var(--default-handle-width);opacity:var(--default-handle-opacity);transition:all 1s;filter:drop-shadow(var(--default-handle-shadow))}.default-handle path{stroke:var(--default-handle-color)}.vertical .first-overlay-container{clip-path:inset(0 0 var(--exposure) 0)}.vertical .handle-container{transform:translateY(50%);height:auto;top:unset;bottom:var(--exposure);width:100%;left:0;flex-direction:row}.vertical .divider:after{height:1px;width:100%;border-top-width:var(--divider-width);border-top-style:solid;border-top-color:var(--divider-color);border-left:0}.vertical .handle{top:auto;left:var(--handle-position-start);transform:translate(calc(-50% - 0.5px), -50%) rotate(90deg)}',""]);const v=u},609:t=>{t.exports=function(a){var r=[];return r.toString=function(){return this.map(function(n){var u=a(n);return n[2]?"@media ".concat(n[2]," {").concat(u,"}"):u}).join("")},r.i=function(n,u,v){typeof n=="string"&&(n=[[null,n,""]]);var f={};if(v)for(var m=0;m<this.length;m++){var g=this[m][0];g!=null&&(f[g]=!0)}for(var e=0;e<n.length;e++){var s=[].concat(n[e]);v&&f[s[0]]||(u&&(s[2]?s[2]="".concat(u," and ").concat(s[2]):s[2]=u),r.push(s))}},r}}},c={};function l(t){var a=c[t];if(a!==void 0)return a.exports;var r=c[t]={id:t,exports:{}};return d[t](r,r.exports,l),r.exports}l.n=t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return l.d(a,{a}),a},l.d=(t,a)=>{for(var r in a)l.o(a,r)&&!l.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},l.o=(t,a)=>Object.prototype.hasOwnProperty.call(t,a),(()=>{var t=l(792);const a="rendered",r=(e,s)=>{const o=e.getBoundingClientRect();let h,b;return s.type==="mousedown"?(h=s.clientX,b=s.clientY):(h=s.touches[0].clientX,b=s.touches[0].clientY),h>=o.x&&h<=o.x+o.width&&b>=o.y&&b<=o.y+o.height};let n;const u={ArrowLeft:-1,ArrowRight:1},v=["horizontal","vertical"],f=e=>({x:e.touches[0].pageX,y:e.touches[0].pageY}),m=e=>({x:e.pageX,y:e.pageY}),g=typeof window<"u"&&(window==null?void 0:window.HTMLElement);typeof window<"u"&&(window.document&&(n=document.createElement("template"),n.innerHTML='<div class="second" id="second"> <slot name="second"><slot name="before"></slot></slot> </div> <div class="first" id="first"> <div class="first-overlay"> <div class="first-overlay-container" id="firstImageContainer"> <slot name="first"><slot name="after"></slot></slot> </div> </div> <div class="handle-container"> <div class="divider"></div> <div class="handle" id="handle"> <slot name="handle"> <svg xmlns="http://www.w3.org/2000/svg" class="default-handle" viewBox="-8 -3 16 6"> <path d="M -5 -2 L -7 0 L -5 2 M 5 -2 L 7 0 L 5 2" fill="none" vector-effect="non-scaling-stroke"/> </svg> </slot> </div> </div> </div> '),window.customElements.define("img-comparison-slider",class extends g{constructor(){super(),this.exposure=this.hasAttribute("value")?parseFloat(this.getAttribute("value")):50,this.slideOnHover=!1,this.slideDirection="horizontal",this.keyboard="enabled",this.isMouseDown=!1,this.animationDirection=0,this.isFocused=!1,this.dragByHandle=!1,this.onMouseMove=o=>{if(this.isMouseDown||this.slideOnHover){const h=m(o);this.slideToPage(h)}},this.bodyUserSelectStyle="",this.bodyWebkitUserSelectStyle="",this.onMouseDown=o=>{if(this.slideOnHover||this.handle&&!r(this.handleElement,o))return;o.preventDefault(),window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mouseup",this.onWindowMouseUp),this.isMouseDown=!0,this.enableTransition();const h=m(o);this.slideToPage(h),this.focus(),this.bodyUserSelectStyle=window.document.body.style.userSelect,this.bodyWebkitUserSelectStyle=window.document.body.style.webkitUserSelect,window.document.body.style.userSelect="none",window.document.body.style.webkitUserSelect="none"},this.onWindowMouseUp=()=>{this.isMouseDown=!1,window.document.body.style.userSelect=this.bodyUserSelectStyle,window.document.body.style.webkitUserSelect=this.bodyWebkitUserSelectStyle,window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onWindowMouseUp)},this.touchStartPoint=null,this.isTouchComparing=!1,this.hasTouchMoved=!1,this.onTouchStart=o=>{this.dragByHandle&&!r(this.handleElement,o)||(this.touchStartPoint=f(o),this.isFocused&&(this.enableTransition(),this.slideToPage(this.touchStartPoint)))},this.onTouchMove=o=>{if(this.touchStartPoint===null)return;const h=f(o);if(this.isTouchComparing)return this.slideToPage(h),o.preventDefault(),!1;if(!this.hasTouchMoved){const b=Math.abs(h.y-this.touchStartPoint.y),S=Math.abs(h.x-this.touchStartPoint.x);if(this.slideDirection==="horizontal"&&b<S||this.slideDirection==="vertical"&&b>S)return this.isTouchComparing=!0,this.focus(),this.slideToPage(h),o.preventDefault(),!1;this.hasTouchMoved=!0}},this.onTouchEnd=()=>{this.isTouchComparing=!1,this.hasTouchMoved=!1,this.touchStartPoint=null},this.onBlur=()=>{this.stopSlideAnimation(),this.isFocused=!1,this.firstElement.classList.remove("focused")},this.onFocus=()=>{this.isFocused=!0,this.firstElement.classList.add("focused")},this.onKeyDown=o=>{if(this.keyboard==="disabled")return;const h=u[o.key];this.animationDirection!==h&&h!==void 0&&(this.animationDirection=h,this.startSlideAnimation())},this.onKeyUp=o=>{if(this.keyboard==="disabled")return;const h=u[o.key];h!==void 0&&this.animationDirection===h&&this.stopSlideAnimation()},this.resetDimensions=()=>{this.imageWidth=this.offsetWidth,this.imageHeight=this.offsetHeight};const e=this.attachShadow({mode:"open"}),s=document.createElement("style");s.innerHTML=t.Z,this.getAttribute("nonce")&&s.setAttribute("nonce",this.getAttribute("nonce")),e.appendChild(s),e.appendChild(n.content.cloneNode(!0)),this.firstElement=e.getElementById("first"),this.handleElement=e.getElementById("handle")}set handle(e){this.dragByHandle=e.toString().toLowerCase()!=="false"}get handle(){return this.dragByHandle}get value(){return this.exposure}set value(e){const s=parseFloat(e);s!==this.exposure&&(this.exposure=s,this.enableTransition(),this.setExposure())}get hover(){return this.slideOnHover}set hover(e){this.slideOnHover=e.toString().toLowerCase()!=="false",this.removeEventListener("mousemove",this.onMouseMove),this.slideOnHover&&this.addEventListener("mousemove",this.onMouseMove)}get direction(){return this.slideDirection}set direction(e){this.slideDirection=e.toString().toLowerCase(),this.slide(0),this.firstElement.classList.remove(...v),v.includes(this.slideDirection)&&this.firstElement.classList.add(this.slideDirection)}static get observedAttributes(){return["hover","direction"]}connectedCallback(){this.hasAttribute("tabindex")||(this.tabIndex=0),this.addEventListener("dragstart",e=>(e.preventDefault(),!1)),new ResizeObserver(this.resetDimensions).observe(this),this.setExposure(0),this.keyboard=this.hasAttribute("keyboard")&&this.getAttribute("keyboard")==="disabled"?"disabled":"enabled",this.addEventListener("keydown",this.onKeyDown),this.addEventListener("keyup",this.onKeyUp),this.addEventListener("focus",this.onFocus),this.addEventListener("blur",this.onBlur),this.addEventListener("touchstart",this.onTouchStart,{passive:!0}),this.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.addEventListener("touchend",this.onTouchEnd),this.addEventListener("mousedown",this.onMouseDown),this.handle=this.hasAttribute("handle")?this.getAttribute("handle"):this.dragByHandle,this.hover=this.hasAttribute("hover")?this.getAttribute("hover"):this.slideOnHover,this.direction=this.hasAttribute("direction")?this.getAttribute("direction"):this.slideDirection,this.resetDimensions(),this.classList.contains(a)||this.classList.add(a)}disconnectedCallback(){this.transitionTimer&&window.clearTimeout(this.transitionTimer)}attributeChangedCallback(e,s,o){e==="hover"&&(this.hover=o),e==="direction"&&(this.direction=o),e==="keyboard"&&(this.keyboard=o==="disabled"?"disabled":"enabled")}setExposure(e=0){var s;this.exposure=(s=this.exposure+e)<0?0:s>100?100:s,this.firstElement.style.setProperty("--exposure",100-this.exposure+"%")}slide(e=0){this.setExposure(e);const s=new Event("slide");this.dispatchEvent(s)}slideToPage(e){this.slideDirection==="horizontal"&&this.slideToPageX(e.x),this.slideDirection==="vertical"&&this.slideToPageY(e.y)}slideToPageX(e){const s=e-this.getBoundingClientRect().left-window.scrollX;this.exposure=s/this.imageWidth*100,this.slide(0)}slideToPageY(e){const s=e-this.getBoundingClientRect().top-window.scrollY;this.exposure=s/this.imageHeight*100,this.slide(0)}enableTransition(){this.firstElement.style.setProperty("--transition-time","100ms"),this.transitionTimer=window.setTimeout(()=>{this.firstElement.style.setProperty("--transition-time","var(--default-transition-time)"),this.transitionTimer=null},100)}startSlideAnimation(){let e=null,s=this.animationDirection;this.firstElement.style.setProperty("--transition-time","var(--keyboard-transition-time)");const o=h=>{if(this.animationDirection===0||s!==this.animationDirection)return;e===null&&(e=h);const b=(h-e)/16.666666666666668*this.animationDirection;this.slide(b),setTimeout(()=>window.requestAnimationFrame(o),0),e=h};window.requestAnimationFrame(o)}stopSlideAnimation(){this.animationDirection=0,this.firstElement.style.setProperty("--transition-time","var(--default-transition-time)")}}))})()})()),L))),p.ImgComparisonSlider=(0,w.forwardRef)(({children:d,onSlide:c,value:l,className:t,...a},r)=>{const n=(0,w.useRef)();return(0,w.useEffect)(()=>{l!==void 0&&(n.current.value=parseFloat(l.toString()))},[l,n]),(0,w.useEffect)(()=>{c&&n.current.addEventListener("slide",c)},[]),(0,w.useImperativeHandle)(r,()=>n.current,[n]),(0,w.createElement)("img-comparison-slider",Object.assign({class:t?`${t} rendered`:"rendered",tabIndex:0,ref:n},a),d)}),p})();const A=E=>{const i=k.c(15),{beforeSrc:y,afterSrc:w,value:d,direction:c,width:l,height:t}=E,a=l||"100%",r=t||(c==="vertical"?"400px":"auto");let n;i[0]!==a||i[1]!==r?(n={width:a,height:r,maxWidth:"100%"},i[0]=a,i[1]=r,i[2]=n):n=i[2];const u=n;let v,f,m,g;return i[3]!==y?(v=x.jsx("img",{slot:"first",src:y,alt:"Before",width:"100%"}),i[3]=y,i[4]=v):v=i[4],i[5]!==w?(f=x.jsx("img",{slot:"second",src:w,alt:"After",width:"100%"}),i[5]=w,i[6]=f):f=i[6],i[7]!==c||i[8]!==v||i[9]!==f||i[10]!==d?(m=x.jsxs(P.ImgComparisonSlider,{value:d,direction:c,children:[v,f]}),i[7]=c,i[8]=v,i[9]=f,i[10]=d,i[11]=m):m=i[11],i[12]!==u||i[13]!==m?(g=x.jsx("div",{style:u,children:m}),i[12]=u,i[13]=m,i[14]=g):g=i[14],g};export{A as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ai as Zt,
|
|
1
|
+
import{ai as Zt,gn as oi,go as _e,gp as er,gq as ai,gr as je,gs as tr,gt as si,d as ue,gu as rr}from"./index-CelXfcd8.js";import{a as li,b as ci,d as fi,c as ui,e as di,f as pi,g as hi,h as mi,i as gi,j as vi,k as Ei,l as bi,m as yi,n as wi,o as Oi,p as Ii,q as Ai,r as Ri,s as $i,t as Ni,u as Si,v as Li,w as Ti,x as xi,y as Pi,z as Ci,A as Fi,B as ki,C as Di,D as _i,E as ji,F as zi,G as Mi,H as Gi,I as Ui,J as Bi,K as Vi,L as Wi,N as Xi,O as Hi,P as Yi,Q as qi,R as Ji,S as Qi,T as Ki}from"./compile-DVQe1Mzk.js";import{e as Zi}from"./index-Db36XTG_.js";const nr={};function it(e,t){e===void 0&&(e=nr),t===void 0&&(t=nr);const r=Object.keys(e),n=Object.keys(t);return e===t||r.length===n.length&&r.every(s=>e[s]===t[s])}/*!
|
|
2
2
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
3
3
|
* (c) 2017-2022 Joachim Wester
|
|
4
4
|
* MIT licensed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{eN as y,eO as l,eP as w,aO as b,eQ as O,eR as g,eS as A,eT as B,cH as H,eU as I,cI as N,B as P,eV as Q,A as R}from"./index-CelXfcd8.js";function h(r){return r==r&&!w(r)}function j(r,e){return function(n){return n!=null&&n[r]===e&&(e!==void 0||r in Object(n))}}function S(r){var e=(function(n){for(var t=b(n),u=t.length;u--;){var i=t[u],o=n[i];t[u]=[i,o,h(o)]}return t})(r);return e.length==1&&e[0][2]?j(e[0][0],e[0][1]):function(n){return n===r||(function(t,u,i,o){var a=i.length,c=a;if(t==null)return!c;for(t=Object(t);a--;){var f=i[a];if(f[2]?f[1]!==t[f[0]]:!(f[0]in t))return!1}for(;++a<c;){var s=(f=i[a])[0],v=t[s],m=f[1];if(f[2]){if(v===void 0&&!(s in t))return!1}else{var x=new y;if(!l(m,v,3,o,x))return!1}}return!0})(n,0,e)}}function T(r){return O(r)?I(g(r)):(function(e){return function(n){return H(n,e)}})(r)}function U(r){return typeof r=="function"?r:r==null?N:typeof r=="object"?P(r)?(e=r[0],n=r[1],O(e)&&h(n)?j(g(e),n):function(t){var u=A(t,e);return u===void 0&&u===n?B(t,e):l(n,u,3)}):S(r):T(r);var e,n}function p(r,e){return r&&Q(r,e,b)}var d,V=(d=p,function(r,e){if(r==null)return r;if(!R(r))return d(r,e);for(var n=r.length,t=-1,u=Object(r);++t<n&&e(u[t],t,u)!==!1;);return r});export{U as a,V as b,p as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as m}from"./_baseEach--KDTwKbG.js";import{A as s}from"./index-CelXfcd8.js";function e(r,o){var a=-1,t=s(r)?Array(r.length):[];return m(r,function(n,f,i){t[++a]=o(n,f,i)}),t}export{e as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{fv as p,aO as d,eJ as m,fw as F,fx as Y,fy as Z,fz as _,fA as rr,fB as B,fC as D,fD as er,fE as M,H as I,cJ as O,fF as A,eP as nr,fG as tr,D as cr,fH as or,fI as ar,eN as ur,fJ as fr,B as g,fK as sr,cI as ir,fL as br,cG as jr,fM as lr,fN as x,fO as N,fP as vr,fQ as yr}from"./index-CelXfcd8.js";import{b as U,a as P}from"./_baseEach--KDTwKbG.js";function C(){}function G(r,e){for(var n=-1,u=r==null?0:r.length;++n<u&&e(r[n],n,r)!==!1;);return r}function J(r,e,n,u){for(var s=r.length,a=n+-1;++a<s;)if(e(r[a],a,r))return a;return-1}function pr(r){return r!=r}function k(r,e,n){return e==e?(function(u,s,a){for(var c=a-1,f=u.length;++c<f;)if(u[c]===s)return c;return-1})(r,e,n):J(r,pr,n)}function H(r,e){return!!(r!=null&&r.length)&&k(r,e,0)>-1}var L=Object.getOwnPropertySymbols?function(r){for(var e=[];r;)Z(e,F(r)),r=_(r);return e}:Y;function R(r){return rr(r,m,L)}var Ar=Object.prototype.hasOwnProperty,gr=/\w*$/,V=D?D.prototype:void 0,z=V?V.valueOf:void 0;function hr(r,e,n){var u,s,a,c=r.constructor;switch(e){case"[object ArrayBuffer]":return B(r);case"[object Boolean]":case"[object Date]":return new c(+r);case"[object DataView]":return(function(f,b){var v=b?B(f.buffer):f.buffer;return new f.constructor(v,f.byteOffset,f.byteLength)})(r,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return er(r,n);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(r);case"[object RegExp]":return(a=new(s=r).constructor(s.source,gr.exec(s))).lastIndex=s.lastIndex,a;case"[object Symbol]":return u=r,z?Object(z.call(u)):{}}}var K=A&&A.isMap,wr=K?O(K):function(r){return M(r)&&I(r)=="[object Map]"},Q=A&&A.isSet,dr=Q?O(Q):function(r){return M(r)&&I(r)=="[object Set]"},W="[object Arguments]",$="[object Function]",q="[object Object]",o={};function h(r,e,n,u,s,a){var c,f=1&e,b=2&e,v=4&e;if(c!==void 0)return c;if(!nr(r))return r;var l=g(r);if(l){if(c=(function(t){var i=t.length,w=new t.constructor(i);return i&&typeof t[0]=="string"&&Ar.call(t,"index")&&(w.index=t.index,w.input=t.input),w})(r),!f)return tr(r,c)}else{var j=I(r),y=j==$||j=="[object GeneratorFunction]";if(cr(r))return or(r,f);if(j==q||j==W||y&&!s){if(c=b||y?{}:ar(r),!f)return b?(function(t,i){return p(t,L(t),i)})(r,(function(t,i){return t&&p(i,m(i),t)})(c,r)):(function(t,i){return p(t,F(t),i)})(r,(function(t,i){return t&&p(i,d(i),t)})(c,r))}else{if(!o[j])return s?r:{};c=hr(r,j,f)}}a||(a=new ur);var S=a.get(r);if(S)return S;a.set(r,c),dr(r)?r.forEach(function(t){c.add(h(t,e,n,t,r,a))}):wr(r)&&r.forEach(function(t,i){c.set(i,h(t,e,n,i,r,a))});var E=l?void 0:(v?b?R:fr:b?m:d)(r);return G(E||r,function(t,i){E&&(t=r[i=t]),sr(c,i,h(t,e,n,i,r,a))}),c}function T(r){return typeof r=="function"?r:ir}function mr(r,e){return(g(r)?G:U)(r,T(e))}function X(r,e){var n=[];return U(r,function(u,s,a){e(u,s,a)&&n.push(u)}),n}function Ir(r,e){return(g(r)?br:X)(r,P(e))}function xr(r){return r==null?[]:(function(e,n){return jr(n,function(u){return e[u]})})(r,d(r))}function Ur(r){return r===void 0}function Sr(r,e,n,u,s){return s(r,function(a,c,f){n=u?(u=!1,a):e(n,a,c,f)}),n}function Er(r,e,n){var u=g(r)?lr:Sr,s=arguments.length<3;return u(r,P(e),n,s,U)}o[W]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object DataView]"]=o["[object Boolean]"]=o["[object Date]"]=o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Map]"]=o["[object Number]"]=o[q]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object Symbol]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Error]"]=o[$]=o["[object WeakMap]"]=!1;var Fr=x&&1/N(new x([,-0]))[1]==1/0?function(r){return new x(r)}:C;function Br(r,e,n){var u=-1,s=H,a=r.length,c=!0,f=[],b=f;if(a>=200){var v=e?null:Fr(r);if(v)return N(v);c=!1,s=yr,b=new vr}else b=e?[]:f;r:for(;++u<a;){var l=r[u],j=e?e(l):l;if(l=l!==0?l:0,c&&j==j){for(var y=b.length;y--;)if(b[y]===j)continue r;e&&b.push(j),f.push(l)}else s(b,j,n)||(b!==f&&b.push(j),f.push(l))}return f}export{Br as a,h as b,mr as c,J as d,T as e,Ir as f,H as g,k as h,Ur as i,R as j,X as k,C as n,Er as r,xr as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a,a as c}from"./_baseEach
|
|
1
|
+
import{b as a,a as c}from"./_baseEach--KDTwKbG.js";import{B as e}from"./index-CelXfcd8.js";function m(r,o,u,t){for(var n=-1,f=r==null?0:r.length;++n<f;){var i=r[n];o(t,i,u(i),r)}return t}function s(r,o,u,t){return a(r,function(n,f,i){o(t,n,u(n),i)}),t}function l(r,o){return function(u,t){var n=e(u)?m:s,f=o?o():{};return n(u,r,c(t),f)}}export{l as c};
|